home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagg_m.zip
/
KEYBOARD.SWG
/
0008_Get Keyboard CLICK.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-28
|
830b
|
34 lines
{$M $800,0,0 } { 2K stack, no heap }
{ This Program caUses a click each time
a key is pressed.}
Uses Crt, Dos;
Var
KbdIntVec : Procedure;
{$F+}
Procedure Keyclick; interrupt;
begin
if Port[$60] < $80 then
{ Only click when key is pressed }
begin
Sound(5000);
Delay(1);
NoSound;
end;
Inline ($9C); { PUSHF -- Push flags }
{ Call old ISR using saved vector }
KbdIntVec;
end;
{$F-}
begin
{ Insert ISR into keyboard chain }
GetIntVec($9,@KbdIntVec);
SetIntVec($9,Addr(Keyclick));
Keep(0); { Terminate, stay resident }
readln;
end.
{
Actually this works as long as you change the GETinTVEC line, where it says
@@KbdIntVec, it should be only one @, odd that borland would have an example
that didn't Compile. (It's a fine example, surprised myself too)
}